Skip to content

ResumableParser: Reset err_info on EOS errors#1009

Merged
byroot merged 1 commit into
ruby:masterfrom
byroot:resumable-string
Jun 16, 2026
Merged

ResumableParser: Reset err_info on EOS errors#1009
byroot merged 1 commit into
ruby:masterfrom
byroot:resumable-string

Conversation

@byroot

@byroot byroot commented Jun 16, 2026

Copy link
Copy Markdown
Member

Fix: #1008

I'm unfortunately unable to turn the reproduction script into a test case there, I don't understand what is causing err_info to be re-raised in the repro that doesn't work in test-unit.

require 'json'
parser = JSON::ResumableParser.new({})
['{"message": "hello ', 'world"}', '[1,2]'].each do |chunk|
  parser << chunk
  begin
    while parser.parse
      p parser.value
    end
  rescue JSON::ParserError => e
    p e
    parser.clear
  end
end

Fix: ruby#1008

I'm unfortunately unable to turn the reproduction script into
a test case there, I don't understand what is causing `err_info`
to be re-raised in the repro that doesn't work in test-unit.

```ruby
require 'json'
parser = JSON::ResumableParser.new({})
['{"message": "hello ', 'world"}', '[1,2]'].each do |chunk|
  parser << chunk
  begin
    while parser.parse
      p parser.value
    end
  rescue JSON::ParserError => e
    p e
    parser.clear
  end
end
```
@byroot byroot merged commit 24a2b08 into ruby:master Jun 16, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON::ResumableParser raises an error unexpected end of input, expected closing " at line 1 column N

1 participant